<script setup>
const userInfo = {
  name: '张三',
  avatar: 'https://placekitten.com/100/100',
  capsuleCount: 8,
  joinDate: '2024-01-01'
}

const statistics = [
  { label: '已创建', value: 12 },
  { label: '待开启', value: 8 },
  { label: '已开启', value: 4 }
]
</script>

<template>
  <div class="personal-center">
    <div class="profile-card">
      <img :src="userInfo.avatar" alt="用户头像" class="avatar">
      <h2>{{ userInfo.name }}</h2>
      <p class="join-date">加入时间：{{ userInfo.joinDate }}</p>
      
      <div class="statistics">
        <div v-for="(stat, index) in statistics" 
             :key="index"
             class="stat-item">
          <div class="stat-value">{{ stat.value }}</div>
          <div class="stat-label">{{ stat.label }}</div>
        </div>
      </div>
    </div>
    
    <div class="settings-card">
      <h3>账号设置</h3>
      <div class="settings-list">
        <button class="setting-item">
          修改个人信息
          <span>></span>
        </button>
        <button class="setting-item">
          隐私设置
          <span>></span>
        </button>
        <button class="setting-item">
          消息通知
          <span>></span>
        </button>
      </div>
    </div>
  </div>
</template>

<style scoped>
.personal-center {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  gap: 2rem;
}

.profile-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.join-date {
  color: #666;
  margin: 1rem 0;
}

.statistics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #3498db;
}

.stat-label {
  color: #666;
  margin-top: 0.5rem;
}

.settings-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.settings-card h3 {
  margin-bottom: 1.5rem;
  color: #2c3e50;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #2c3e50;
  transition: background-color 0.3s;
}

.setting-item:hover {
  background-color: #f5f7fa;
}

.setting-item span {
  color: #999;
}
</style> 